<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>filters过滤普通数据</title>
    <script src="../../js/vue.js"></script>
</head>

<body>
    <div id="app">
        <p> {{text}} </p>
        <p>{{text|addBefore}}</p>
    </div>
    <script>
        var v_app = new Vue({
            el: "#app",
            data: {
                text: "hi star",
            },
            filters: {
                addBefore(str) {
                    return "hi " + str
                }
            }
        });
    </script>
</body>

</html>